import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
import naive from 'naive-ui'
import mitt from 'mitt'
import _ from 'lodash'


import "./assets/css/styles.css"
import "./assets/css/dark.css"
import './assets/css/iconfont.js'

const app = createApp(App)

const pinia = createPinia()
pinia.use(piniaPersist)
const Mit = mitt()

// 用于扩充组件实例类型以支持自定义全局属性。
declare module 'vue' {
    export interface ComponentCustomProperties {
        $Bus: typeof Mit
        $_: typeof _
    }
}

// 注册全局属性
app.config.globalProperties.$Bus = Mit
app.config.globalProperties.$_ = _
window.$router = router

app.use(pinia)
app.use(naive)
app.use(router)

app.mount('#app')
